import { toFail, useEntityManager } from '@sker/core';
import { useData } from '@sker/runtime';
import dayjs from 'dayjs';
import { z } from 'zod';

export default async () => {
    const input = z.object({
        uuid: z.string()
    });
    const body = input.parse(useData());
    return await useEntityManager(async m => {
        const start = dayjs().add(20, 'second').toDate()
        const end = dayjs().add(60 * 2, 'second').toDate()
        // const item = await m.findOne(KsAccount, { where: { open_time: Between(start, end) } })
        // if (item) {
        //     return toSuccess(item)
        // }
        return toFail(`暂无红包`)
    })
}
